import java.util.Comparator;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;

public class PriorityQueue<T> {

	private Comparator<T> comparator;
	private ArrayList<T> list;

	public PriorityQueue(Comparator<T> comp) {
		this.comparator = comp;
		list = new ArrayList<>();
	}

	public void enqueue(T value) {
		list.add(value);
		Collections.sort(list, comparator);

	}

	// alle ausgeben
	public T dequeue() {
		T temp = (T) list.toString();
		return temp;
	}

	public boolean isEmpty() {
		return (list.size() == 0);
	}

}